package org.file_service.controller;

import org.file_service.entity.History;
import org.file_service.lang.Result;
import org.file_service.service.HistoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@Controller
@RequestMapping("/history")
public class HistoryController {
    @Autowired
    public HistoryService historyService;

    @ResponseBody
    @GetMapping("/record")
    public Result record(){
        return historyService.allRecord();
    }

    @ResponseBody
    @GetMapping("/two")
    public Result two(Integer userId,Integer historyId){
        return historyService.two(userId,historyId);
    }

    @ResponseBody
    @GetMapping("/three")
    public Result three(Integer userId,Integer historyId){
        return historyService.three(userId,historyId);
    }

    @ResponseBody
    @GetMapping("/four")
    public Result four(Integer userId,Integer historyId){
        return historyService.four(userId,historyId);
    }

    @ResponseBody
    @GetMapping("/five")
    public Result five(Integer userId,Integer historyId){
        return historyService.five(userId,historyId);
    }

    @ResponseBody
    @GetMapping("/six")
    public Result six(Integer userId,Integer historyId){
        return historyService.six(userId,historyId);
    }

    @ResponseBody
    @GetMapping("/seven")
    public Result seven(Integer userId,Integer historyId){
        return historyService.seven(userId,historyId);
    }

    @ResponseBody
    @GetMapping("/eight")
    public Result eight(Integer userId,Integer historyId){
        return historyService.eight(userId,historyId);
    }

    @ResponseBody
    @GetMapping("/one")
    public Result one(int historyId) {
        return historyService.huxingDistributionAndPrice(historyId);
    }

    @ResponseBody
    @GetMapping("/ten")
    public Result ten(int historyId) {
        return historyService.monthAndPrice(historyId);
    }

    @ResponseBody
    @GetMapping("/nine")
    public Result nine(int historyId) {
        return historyService.GuaPaiAndChengjiao(historyId);
    }
}
